<?php
require_once("vcl/vcl.inc.php");
require_once("lib/db_connection.php");
//Includes
use_unit("components4phpfull/jtsitetheme.inc.php");
use_unit("components4phpfull/jtiframe.inc.php");
use_unit("forms.inc.php");
use_unit("extctrls.inc.php");
use_unit("stdctrls.inc.php");


//Class definition
class agent extends Page
{
       public $hfcount = null;
       public $Label1 = null;
       public $flaguser = null;
       public $imgDefault = null;
       public $imgUser = null;
       public $JTFrameAdmin = null;
       public $JTSiteTheme1 = null;
       public $imgAmps = null;
       function agentCreate($sender, $params)
       {
       $query_account = "SELECT * FROM accounts_tbl where approval=0";
       $result_account = mysql_query($query_account);
       $acct_count = mysql_num_rows($result_account);

       $this->hfcount->setValue($acct_count);

       }


       function agentJSLoad($sender, $params)
       {

       ?>
       var width = 800;
       var left = Math.floor((screen.availWidth/2) - (width/2));
       document.getElementById('JTFrameAdmin_outer').style.left = left;
       var left_user = left+183;
       var left_default = left+337;
       document.getElementById('imgUser_outer').style.left = left_user;
       document.getElementById('imgDefault_outer').style.left = left_default;
       document.getElementById('imgAmps_outer').style.left = left;
       document.getElementById('Label1_outer').style.left = left;
       <?php

       }

       function imgDefaultJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgDefault'].src="image/default_value.png"
       <?php

       }

       function imgDefaultJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgDefault'].src="image/default_value2.png"
       <?php

       }


       function imgDefaultJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.getElementById('JTFrameAdmin').src = 'admin_standard_droplist.php';
       <?php

       }

       function imgUserJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgUser'].src="image/user_management.png"
       <?php

       }

       function imgUserJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgUser'].src="image/user_management2.png"
       <?php

       }

       function imgUserJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       var count=document.getElementById('hfcount').value;
       document.getElementById('JTFrameAdmin').src = 'agent_user_view.php?ac='+count;
       <?php

       }


       function lblDefaultJSClick($sender, $params)
       {

       ?>
       document.getElementById('JTFrameAdmin').src = 'admin_standard_droplist.php';
       <?php

       }


}

global $application;

global $agent;

//Creates the form
$agent=new agent($application);

//Read from resource file
$agent->loadResource(__FILE__);

//Shows the form
$agent->show();

?>